﻿using System;

namespace ActorSystem
{
    /// <summary>
    /// 场景同步操作命令特性
    /// </summary>
    [AttributeUsage(AttributeTargets.Method)]
    public class OperCmd : Attribute
    {
        public byte cmd;

        public OperCmd(params object[] values)
        {
            foreach (var value in values)
            {
                var typeCode = Type.GetTypeCode(value.GetType());
                if (typeCode == TypeCode.Byte || typeCode == TypeCode.SByte)
                {
                    cmd = Convert.ToByte(value);
                }
            }
        }
    }
}